package com.lyhui.nursinguser5010.service.impl;

import com.lyhui.nursinguser5010.pojo.RoleRelationship;
import com.lyhui.nursinguser5010.dao.RoleRelationshipMapper;
import com.lyhui.nursinguser5010.service.RoleRelationshipService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * RoleRelationship表的服务实现类
 *
 * @author lyhui
 * @create-time 2020-02-19 00:37:47
 */
@Service("roleRelationshipService")
public class RoleRelationshipServiceImpl implements RoleRelationshipService {
    //private static final Logger logger = LoggerFactory.getLogger(RoleRelationshipServiceImpl.class);
    
    @Resource
    private RoleRelationshipMapper roleRelationshipMapper;
    
    /**
     * 查询RoleRelationship表的所有记录
     *
     * @return RoleRelationship的实例对象集合List（封装了RoleRelationship表的所有记录）
     */
    @Override
    public List<RoleRelationship> queryAllRoleRelationship() {
        return this.roleRelationshipMapper.queryAllRoleRelationship();
    }
    
    /**
     * 查询RoleRelationship表中的一条记录
     *
     * @param  roleRelationship（封装了相关查询条件）
     * @return RoleRelationship的实例对象（封装了RoleRelationship表的一条记录）
     */
     @Override
    public RoleRelationship queryRoleRelationshipByParam(RoleRelationship roleRelationship){
        if(roleRelationship==null){
            return null;
        }
        return this.roleRelationshipMapper.queryRoleRelationshipByParam(roleRelationship);
    }
    
    /**
     * 查询RoleRelationship表中的多条记录
     *
     * @param  roleRelationship（封装了相关查询条件）
     * @return RoleRelationship的实例对象集合List（封装了RoleRelationship表的多条记录）
     */
    public List<RoleRelationship> queryRoleRelationshipListByParam(RoleRelationship roleRelationship){
        if(roleRelationship==null){
            return null;
        }
        return this.roleRelationshipMapper.queryRoleRelationshipListByParam(roleRelationship);
    }
    
    /**
     * 在RoleRelationship表中的添加一条记录
     *
     * @param  roleRelationship（封装了想要添加的记录信息）
     * @return 添加记录的反馈结果(1:添加记录成功；0：添加记录失败)
     */
    @Override
    public int insertRoleRelationship(RoleRelationship roleRelationship) {
        if(roleRelationship==null){
            return 0;
        }
        return this.roleRelationshipMapper.insertRoleRelationship(roleRelationship);
    }

    /**
     * 修改RoleRelationship表中的一条记录
     *
     * @param  roleRelationship（封装了准备修改的记录信息）
     * @return 修改记录的反馈结果(1:修改记录成功；0：修改记录失败)
     */
    @Override
    public int updateRoleRelationship(RoleRelationship roleRelationship) {
        if(roleRelationship==null){
            return 0;
        }
        return this.roleRelationshipMapper.updateRoleRelationship(roleRelationship);
    }

    /**
     * 删除RoleRelationship表中的一条记录
     *
     * @param  id ： RoleRelationship表的主键
     * @return 删除记录反馈结果(1：删除记录成功|0：删除记录失败)
     */
    @Override
    public int deleteRoleRelationshipById(Integer id) {
        if(id==null){
            return 0;
        }
        return this.roleRelationshipMapper.deleteRoleRelationshipById(id);
    }
}